﻿@model HQPad.Models.CharacterImportResult

@{
    ViewBag.Title = "Results";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1>Character import results</h1>

<section class="content">
    <div class="block">
        <p>The import process has completed <span>@Html.Raw((Model.Success) ? Model.AnyWarnings() ? "successfully but with warnings": "successfully" : "with errors" )</span></p>

        <p>Review the results of the import operation in the table below.</p>

        @if (Model.Success)
        {
            <p>Your imported character has been saved to the scratch pad and once you've reviewed it you can save it as one of your permanent characters.<br />
            Care must be taken however, if you already have a saved character with the same name as you may overwrite it.  If you want to keep both then 
            just change the name of the character in the scratch pad.</p>
            
            <p>@Html.ActionLink("Go to dashboard", "Dashboard", "Home", null, new { @class = "button" })</p>
        }
    </div>

    <h2>Import results</h2>
    <table class="import-results">
        <thead>
            <tr>
                <th>State</th>
                <th>Message</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var message in Model.Messages)
            {
                <tr @((message.IsError) ? "class=error" : (message.IsWarning) ? "class=warning" : "class=ok")>
                    <td>@Html.Raw((message.IsError) ? "Error" : (message.IsWarning) ? "Warning" : "Ok")</td>
                    <td>@Html.Raw(message.Message)</td>
                </tr>
            }
        </tbody>
    </table>
</section>

@if (Model.Success)
{
    <section class="sidebar">
        <h2>Next steps</h2>
        <div class="sidebar-container">
            Your character has successfully been imported to the scratch pad.
            <br />
            <br />
            Follow these next steps to complete you character import.
            <ul>
                <li>Check that all your skills have been loaded and that your point total and total spent are correct.</li>
                <li>If your character has been loaded as the default 'mystery hero' make sure you change the character name before you save.</li>
                <li>On the magic tab, check that the correct spell schools are selected and assign the relevant 'learn spell' status to your schools.  
                Also check that the learnt spells are correct.</li>
                <li>On the power tab, check that the sect access is correct and assign status to your sects.  Also check that the learnt invocations
                are correct.</li>
                <li>Armour is not imported so add any armour, headwear and tabrds that your character has.  Armour must be equipped to be effective.</li>
                <li>Items, abilities, scrolls and potions are not imported so add any that are required.  You can add special qualities that directly affect
                your characters statistics.</li>
                <li>Make sure that you regularly save your character!  if you don't want to overwrite an existing one of the same name, change the character
                name temporarily.</li>
            </ul>
        </div>
    </section>
}
        